<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>文件列表</title>
</head>
<body>
	<div>
		<form action="upload" method="post" enctype="multipart/form-data">
		<table border="1" style="margin: 0 auto">
			<tr>
				<td colspan="4"><input type="file" name="img"/></td>
				<td><input type="submit" name="上传"/></td>
			</tr>
			<tr>
				<th>图片</th>
				<th>文件名</th>
				<th>图片大小</th>
				<th>上传时间</th>
				<th>操作</th>
			</tr>
			<c:forEach items="${imgs}" var="img">
			<tr>
				<td><img src="${img.url}" alt="${img.name}" width="50" height="50"/></td>
				<td><a href="${img.url}" target="_blank">${img.name}</a></td>
				<td>${img.size}b</td>
				<td><fmt:formatDate value="${img.createTime}" pattern="yyyy-MM-dd hh:mm:ss "/></td>
				<td><a href="delete?img=${img.name}">删除</a></td>
			</tr>
			</c:forEach>
		</table>
		</form>
	</div>
</body>
</html>